package org.advanced.collection;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * @author John.zhang
 * @version Id: ArrayLists, v 1.0 2020/12/2 11:23 ZhiYong Exp $
 */
public class ArrayLists {

    private static List list = new ArrayList();

    public static void main(String[] args) {
        //本质是一个数组，实现了动态扩容
        ArrayList arrayList = new ArrayList();
        arrayList.add("a");
        arrayList.get(0);
        //取最大值
        Math.max(10, 1);

        new ThreadAdd(list).start();
        new ThreadIterator(list).start();

        //线程安全 vector作为线程安全已经过时
        Collections.synchronizedList(list);
    }

}
